(use-modules (guix packages)
             (guix download)
             (guix git-download)
             (guix build-system gnu)
             (guix licenses)
             ;; copied from guile-json, not sure if it is really needed
             (gnu packages pkg-config)
             ;; in the guix repo there is (define-public guile-3.0 ...) but the
             ;; name is set to "guile". guile is an input to our package,
             ;; because our package is a guile library.
             (gnu packages guile))

(define-public guile-fslib
  (package
    (name "guile-fslib")
    (version "0.2.0")
    (source
     (origin
      (method git-fetch)
      (uri (git-reference
            (url "https://notabug.org/ZelphirKaltstahl/guile-fslib.git")
            (commit version)))
      ;; (method url-fetch)
      ;; (uri
      ;;  (string-append "https://notabug.org/ZelphirKaltstahl/guile-fslib/archive/"
      ;;                 version
      ;;                 ".tar.gz"))
      ;; calculate the string using "guix hash the-file"
      (sha256
       (base32
        "0lwwkwd2h9m967z19midbvgslfppb0a45f328zrx8z4fgl549kl1"))))
    (build-system gnu-build-system)
    (native-inputs
     `(("guile" ,guile-3.0)))

    ;; inputs (copied from guile-json)
    ;; (native-inputs `(("pkg-config" ,pkg-config)
    ;;                  ("guile" ,guile-3.0)))
    ;; (inputs `(("guile" ,guile-3.0)))
    ;; metadata fields
    (synopsis "file system library for GNU Guile")
    (description
     "guile-fslib is a library, which aims to simplify working with locations in the file system.")
    (home-page "no website")
    (license agpl3)))

guile-fslib
